//
//  HeaderCell.m
//  LBNestScrollTableView
//
//  Created by liubo on 2022/10/15.
//

#import "HeaderCell.h"
#import <Masonry/Masonry.h>

@interface HeaderCell ()

@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation HeaderCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUpUI];
        [self setUpContraints];
    }
    return self;
}

- (void)setUpUI
{
    self.contentView.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.titleLabel];
}

- (void)setUpContraints
{
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.centerX.mas_equalTo(0);
    }];
}

#pragma mark - lazy load

- (UILabel *)titleLabel
{
    if (!_titleLabel){
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = [UIFont systemFontOfSize:30];
        _titleLabel.textColor = [UIColor blackColor];
        _titleLabel.text = @"我是头部";
        _titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLabel;
}

@end
